package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmCoursefaceApply;
import com.drm.netschool.entity.DrmCoursefaceApplyExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmCoursefaceApplyMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    int countByExample(DrmCoursefaceApplyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    int deleteByExample(DrmCoursefaceApplyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    @Delete({
        "delete from drm_courseface_apply",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    @Insert({
        "insert into drm_courseface_apply (id, user_id, ",
        "course_id, apply_dt, ",
        "handle_tp, handle_id, ",
        "handle_remark, apply_remark, ",
        "join_yn)",
        "values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=BIGINT}, ",
        "#{courseId,jdbcType=BIGINT}, #{applyDt,jdbcType=TIMESTAMP}, ",
        "#{handleTp,jdbcType=TIMESTAMP}, #{handleId,jdbcType=BIGINT}, ",
        "#{handleRemark,jdbcType=VARCHAR}, #{applyRemark,jdbcType=VARCHAR}, ",
        "#{joinYn,jdbcType=INTEGER})"
    })
    int insert(DrmCoursefaceApply record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    int insertSelective(DrmCoursefaceApply record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    List<DrmCoursefaceApply> selectByExample(DrmCoursefaceApplyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    @Select({
        "select",
        "id, user_id, course_id, apply_dt, handle_tp, handle_id, handle_remark, apply_remark, ",
        "join_yn",
        "from drm_courseface_apply",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    DrmCoursefaceApply selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmCoursefaceApply record, @Param("example") DrmCoursefaceApplyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    int updateByExample(@Param("record") DrmCoursefaceApply record, @Param("example") DrmCoursefaceApplyExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    int updateByPrimaryKeySelective(DrmCoursefaceApply record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_courseface_apply
     *
     * @mbggenerated Sun Nov 29 23:10:52 CST 2015
     */
    @Update({
        "update drm_courseface_apply",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "course_id = #{courseId,jdbcType=BIGINT},",
          "apply_dt = #{applyDt,jdbcType=TIMESTAMP},",
          "handle_tp = #{handleTp,jdbcType=TIMESTAMP},",
          "handle_id = #{handleId,jdbcType=BIGINT},",
          "handle_remark = #{handleRemark,jdbcType=VARCHAR},",
          "apply_remark = #{applyRemark,jdbcType=VARCHAR},",
          "join_yn = #{joinYn,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DrmCoursefaceApply record);
}